package pro.softzhang.algo.lc0;

/**
 *
 */
public class LC27_RemoveElement {
    public static void main(String[] args) {

    }

    /**
     *
     */
    static
    class Solution {
        public int removeElement(int[] nums, int val) {
            int n = nums.length, left = 0;
            for (int right = 0; right < n; right++) {
                if (nums[right] != val) {
                    nums[left] = nums[right];
                    left++;
                }
            }
            return left;
        }
    }
}
